package com.qingxin.park.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.annotations.GenericGenerator;

/**
 * 作物环节表
 */
@Entity
@Table(name = "production_yz_link")
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class ProductionyzLink extends com.qingxin.sys.entity.BaseEntity implements
		java.io.Serializable {
	private static final long serialVersionUID = -8808748124953291444L;
	// Fields

	private String linkid;
	private Cropsyz crops;
	private String linkCode;
	private String linkName;
	private Integer linkType;//0基本环节、1喂养环节、2防疫环节、3出栏环节
	private Integer sort;
	private String icon;
	private String remark;
	private String createBy;
	private Date createTime;
	private String updateBy;
	private Date updateTime;

	// Constructors

	/** default constructor */
	public ProductionyzLink() {
	}

	/** minimal constructor */
	public ProductionyzLink(Cropsyz crops) {
		this.crops = crops;
	}

	
	public ProductionyzLink(String linkid, String linkName, Integer linkType) {
		this.linkid = linkid;
		this.linkName = linkName;
		this.linkType = linkType;
	}

	public ProductionyzLink(String linkid, String linkCode, String linkName, Integer linkType,
			Integer sort, String cropName) {
		this.linkid = linkid;
		this.linkCode = linkCode;
		this.linkName = linkName;
		this.linkType = linkType;
		this.sort = sort;
		crops = new Cropsyz(null, cropName);
	}

	/** full constructor */
	public ProductionyzLink(Cropsyz crops, String linkCode, String linkName, Integer linkType,
			Integer sort, String icon, String remark, String createBy,
			Date createTime, String updateBy, Date updateTime) {
		this.crops = crops;
		this.linkCode = linkCode;
		this.linkName = linkName;
		this.linkType = linkType;
		this.sort = sort;
		this.icon = icon;
		this.remark = remark;
		this.createBy = createBy;
		this.createTime = createTime;
		this.updateBy = updateBy;
		this.updateTime = updateTime;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "linkid", unique = true, nullable = false, length = 32)
	public String getLinkid() {
		return this.linkid;
	}

	public void setLinkid(String linkid) {
		this.linkid = linkid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cropid", nullable = false)
	public Cropsyz getCrops() {
		return this.crops;
	}

	public void setCrops(Cropsyz crops) {
		this.crops = crops;
	}

	@Column(name = "link_code", length = 20)
	public String getLinkCode() {
		return this.linkCode;
	}

	public void setLinkCode(String linkCode) {
		this.linkCode = linkCode;
	}

	@Column(name = "link_name", length = 50)
	public String getLinkName() {
		return this.linkName;
	}

	public void setLinkName(String linkName) {
		this.linkName = linkName;
	}

	@Column(name = "link_type")
	public Integer getLinkType() {
		return linkType;
	}

	public void setLinkType(Integer linkType) {
		this.linkType = linkType;
	}

	@Column(name = "sort")
	public Integer getSort() {
		return this.sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	@Column(name = "icon", length = 100)
	public String getIcon() {
		return this.icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	@Column(name = "remark", length = 1000)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "create_by", length = 32)
	public String getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	@Column(name = "create_time", length = 23)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "update_by", length = 32)
	public String getUpdateBy() {
		return this.updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	@Column(name = "update_time", length = 23)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

}